home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / bnklysrc / b_whack.c < prev    next >
C/C++ Source or Header  |  1989-02-13  |  6KB  |  132 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software <no-Inc>                   */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          No-Cost<no-tm> Software.                       */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  Copyright (C) 1987, 1988, 1989 by Robert Hartman and Vincent Perriello  */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*                 This module was written by Bob Hartman                   */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*                 BinkleyTerm FTSC Mail Session Routines                   */
  17. /*                                                                          */
  18. /*                                                                          */
  19. /*    For complete  details  of the licensing restrictions, please refer    */
  20. /*    to the License  agreement,  which  is published in its entirety in    */
  21. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.210.    */
  22. /*                                                                          */
  23. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  24. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  25. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  26. /*    NOT HAVE THESE FILES,  YOU SHOULD  IMMEDIATELY CONTACT THE AUTHORS    */
  27. /*    AT THE  ADDRESSES LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO    */
  28. /*    USE   THIS  FILE  WITHOUT  HAVING   ACCEPTED  THE  TERMS  OF   THE    */
  29. /*    BINKLEYTERM  LICENSING AGREEMENT,  OR SUCH OTHER  AGREEMENT AS YOU    */
  30. /*    ARE ABLE TO REACH WITH THE AUTHORS.                                   */
  31. /*                                                                          */
  32. /*                                                                          */
  33. /*    The Authors can be reached at the following addresses:                */
  34. /*                                                                          */
  35. /*    Robert C. Hartman                      Vincent E. Perriello           */
  36. /*    Spark Software                         VEP Software                   */
  37. /*    427-3 Amherst Street                   111 Carroll Street             */
  38. /*    CS2032, Suite 232                      Naugatuck, CT 06770            */
  39. /*    Nashua, NH 03061                                                      */
  40. /*                                                                          */
  41. /*    FidoNet 1:132/101                      FidoNet 1:141/491              */
  42. /*    Data    (603) 888-8179                 Data    (203) 729-7569         */
  43. /*                                                                          */
  44. /*    Please feel free to contact us at any time to share your comments     */
  45. /*    about our software and/or licensing policies.                         */
  46. /*                                                                          */
  47. /*--------------------------------------------------------------------------*/
  48.  
  49. #include <ctype.h>
  50. #include <conio.h>
  51. #include <string.h>
  52.  
  53. #define WAZOO_SECTION
  54. #define MATRIX_SECTION
  55.  
  56. #include "com.h"
  57. #include "xfer.h"
  58. #include "zmodem.h"
  59. #include "keybd.h"
  60. #include "sbuf.h"
  61. #include "sched.h"
  62. #include "externs.h"
  63. #include "prototyp.h"
  64.  
  65. int Whack_CR ()
  66. {
  67.    long t1, t2, timerset ();
  68.    unsigned char j;
  69.    char m;
  70.    int l;
  71.    unsigned int i;
  72.    char buf[80];
  73.  
  74.    t1 = timerset (3000);                         /* set 30 second timeout */
  75.    j = CR;
  76.    strcpy (buf, "Intro: ");
  77.    l = strlen (buf);
  78.    m = 0;
  79.    while (!timeup (t1) && CARRIER)               /* till then or CD lost  */
  80.       {
  81.  
  82.       /* Send either the CR or SPACE */
  83.       SENDBYTE (j);
  84.  
  85.       /* Now switch to either CR or SPACE based on last output */
  86.       j = (unsigned char) (45 - j);
  87.  
  88.       /* Now read what we get back to see if we get anything useful */
  89.       while (((i = TIMED_READ (0)) != (unsigned int)EOF) && (!timeup (t1)) && CARRIER)
  90.          {
  91.          if (i == CR)
  92.             {
  93.             if (m)
  94.                {
  95.                if (un_attended && fullscreen)
  96.                   {
  97.                   clear_filetransfer ();
  98.                   sb_move (filewin, 1, 2);
  99.                   sb_puts (filewin, buf);
  100.                   sb_show ();
  101.                   }
  102.                else
  103.                   {
  104.                   set_xy (NULL);
  105.                   scr_printf (buf);
  106.                   }
  107.                /* We got what we wanted */
  108.                /* Now try to stop output on an Opus */
  109.                SENDBYTE (' ');
  110.                return (0);
  111.                }
  112.             }
  113.          else if (i >= ' ')
  114.             {
  115.             buf[l++] = (char) (i & 0xff);
  116.             buf[l] = '\0';
  117.             if (l > 70)
  118.                l = 70;
  119.             m = 1;
  120.             }
  121.          }
  122.  
  123.       /* Delay for a second */
  124.       t2 = timerset (100);
  125.       while (!timeup (t2))
  126.          time_release ();
  127.       }
  128.  
  129.    status_line ("*Nobody answered the door");
  130.    return (-1);
  131. }
  132.